#include <QtCore/QCoreApplication>
#include <iostream>

#include "LBuildVersion.h"

using namespace std;

int main(int argc, char *argv[]) {
    QCoreApplication a(argc, argv);

    const int major = atoi(argv[1]);
    const int minor = atoi(argv[2]);
    QString svnFolder     = QString(argv[3]);
    QString prjDirVerFile = QString(argv[4]);

    if(prjDirVerFile.length() == 0)
        prjDirVerFile = QCoreApplication::applicationDirPath()+"/version.h";

    LBuildVersion *ver = new LBuildVersion();
    if(ver->generateVersion(major,
                            minor,
                            svnFolder,
                            prjDirVerFile)) {

        delete ver;
        cout << "error generating version file" << endl;
        return 1;
    }
    return 0;

    //return a.exec();
}
